#!/bin/sh

# Usage example: 
# bash$ bash start_single_join.sh
# bash$ bash start_single_join.sh 4

I=$1;
if [ -z $I ]
then I=1
fi

SHORTHOST=$(hostname --short)

echo "Going to start a joining node called node$I"
echo "Short hostname is $SHORTHOST"

echo "Running compiler"
erl -make
echo "Starting joining node called node$I"
erl -pa ebin/ -setcookie apa -sname node$I \
    -s node start_join node@$SHORTHOST


